home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / rpcsvc / mount.x < prev    next >
Text File  |  1990-01-29  |  3KB  |  136 lines

  1. /*    @(#)mount.x    1.2 88/05/08 4.0NFSSRC SMI    */
  2.  
  3. /* 
  4.  * Copyright (c) 1988 by Sun Microsystems, Inc.
  5.  * @(#) from SUN 1.4
  6.  */
  7.  
  8. /*
  9.  * Protocol description for the mount program
  10.  */
  11.  
  12.  
  13. const MNTPATHLEN = 1024;    /* maximum bytes in a pathname argument */
  14. const MNTNAMLEN = 255;        /* maximum bytes in a name argument */
  15. const FHSIZE = 32;        /* size in bytes of a file handle */
  16.  
  17. /*
  18.  * The fhandle is the file handle that the server passes to the client.
  19.  * All file operations are done using the file handles to refer to a file
  20.  * or a directory. The file handle can contain whatever information the
  21.  * server needs to distinguish an individual file.
  22.  */
  23. typedef opaque fhandle[FHSIZE];    
  24.  
  25. /*
  26.  * If a status of zero is returned, the call completed successfully, and 
  27.  * a file handle for the directory follows. A non-zero status indicates
  28.  * some sort of error. The status corresponds with UNIX error numbers.
  29.  */
  30. union fhstatus switch (unsigned fhs_status) {
  31. case 0:
  32.     fhandle fhs_fhandle;
  33. default:
  34.     void;
  35. };
  36.  
  37. /*
  38.  * The type dirpath is the pathname of a directory
  39.  */
  40. typedef string dirpath<MNTPATHLEN>;
  41.  
  42. /*
  43.  * The type name is used for arbitrary names (hostnames, groupnames)
  44.  */
  45. typedef string name<MNTNAMLEN>;
  46.  
  47. /*
  48.  * A list of who has what mounted
  49.  */
  50. struct mountlist {
  51.     name ml_hostname;
  52.     dirpath ml_directory;
  53.     mountlist *ml_next;
  54. };
  55.  
  56. /*
  57.  * A list of netgroups
  58.  */
  59. typedef struct groupnode *groups;
  60. struct groupnode {
  61.     name gr_name;
  62.     groups gr_next;
  63. };
  64.  
  65. /*
  66.  * A list of what is exported and to whom
  67.  */
  68. typedef struct exportnode *exports;
  69. struct exportnode {
  70.     dirpath ex_dir;
  71.     groups ex_groups;
  72.     exports ex_next;
  73. };
  74.  
  75. program MOUNTPROG {
  76.     /*
  77.      * Version one of the mount protocol communicates with version two
  78.      * of the NFS protocol. The only connecting point is the fhandle 
  79.      * structure, which is the same for both protocols.
  80.      */
  81.     version MOUNTVERS {
  82.         /*
  83.          * Does no work. It is made available in all RPC services
  84.          * to allow server reponse testing and timing
  85.          */
  86.         void
  87.         MOUNTPROC_NULL(void) = 0;
  88.  
  89.         /*    
  90.          * If fhs_status is 0, then fhs_fhandle contains the
  91.           * file handle for the directory. This file handle may
  92.          * be used in the NFS protocol. This procedure also adds
  93.          * a new entry to the mount list for this client mounting
  94.          * the directory.
  95.          * Unix authentication required.
  96.          */
  97.         fhstatus 
  98.         MOUNTPROC_MNT(dirpath) = 1;
  99.  
  100.         /*
  101.          * Returns the list of remotely mounted filesystems. The 
  102.          * mountlist contains one entry for each hostname and 
  103.          * directory pair.
  104.          */
  105.         mountlist
  106.         MOUNTPROC_DUMP(void) = 2;
  107.  
  108.         /*
  109.          * Removes the mount list entry for the directory
  110.          * Unix authentication required.
  111.          */
  112.         void
  113.         MOUNTPROC_UMNT(dirpath) = 3;
  114.  
  115.         /*
  116.          * Removes all of the mount list entries for this client
  117.          * Unix authentication required.
  118.          */
  119.         void
  120.         MOUNTPROC_UMNTALL(void) = 4;
  121.  
  122.         /*
  123.          * Returns a list of all the exported filesystems, and which
  124.          * machines are allowed to import it.
  125.          */
  126.         exports
  127.         MOUNTPROC_EXPORT(void)  = 5;
  128.     
  129.         /*
  130.          * Identical to MOUNTPROC_EXPORT above
  131.          */
  132.         exports
  133.         MOUNTPROC_EXPORTALL(void) = 6;
  134.     } = 1;
  135. } = 100005;
  136.